class A(object):
    name = "python"

    def __init__(self):
        self.age =18

    def a_print(self):
        print("aaa")

    @classmethod
    def b_print(cls):
        print(cls.__name__)

    @staticmethod
    def c_print():
        print("static")


# 类名可以直接调用类方法，类方法
# print(A.name)
# A.b_print()
# 类名对象调用实例对象和方法
# print(A().age)
# print(A().a_print)
#
# 实例对象
a = A()
print(a.age)
print(a.name)
a.num = 10000



def func(*args):
    print(a.num)


func(a)




class B():


    # def func(self,a):
        # print(a.num)
        # a.a_print()

# b = B()
# b.func(a)
    def __init__(self):
        self.a=A()


b = B()
b.a.a_print()
b.a.b_print()
print(b.a.age)







# 一个类去调用另一个类方法的时候，可以通过继承／赋值（把对象传递过去

